
Partial Class Usercontrols_Main
    Inherits UserControlBase

#Region " Enums, Memebers and Properties "



#End Region

#Region " Page Events "

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        SetPageTitle("Home")
        SetPageState()
    End Sub

#End Region

#Region " Save Data "



#End Region

#Region " Load Data "

    Private Sub LoadSettings()
        UserActivityPanel.Visible = DisplayUserActivity
        TagsPanel.Visible = DisplayTags
        MostRecentPagesPanel.Visible = DisplayPages
        MostRecentBlogsPanel.Visible = DisplayBlogs
        MostRecentEventsPanel.Visible = DisplayEvents
        MostRecentPostPanel.Visible = DisplayPosts
        MostRecentPollPanel.Visible = DisplayPolls
        SlideShowsPanel.Visible = DisplaySlideShow
        uxLinksPanel.Visible = DisplayLinks
		uxRecentActivityPanel.Visible = DisplayRecentForumActivity

        UserActivityPanel.Enabled = DisplayUserActivity
        TagsPanel.Enabled = DisplayTags
        MostRecentPagesPanel.Enabled = DisplayPages
        MostRecentBlogsPanel.Enabled = DisplayBlogs
        MostRecentEventsPanel.Enabled = DisplayEvents
        MostRecentPostPanel.Enabled = DisplayPosts
        MostRecentPollPanel.Enabled = DisplayPolls
        SlideShowsPanel.Enabled = DisplaySlideShow
		uxLinksPanel.Enabled = DisplayLinks
		uxRecentActivityPanel.Enabled = DisplayRecentForumActivity
    End Sub

#End Region

#Region " Form Controls Events "

    Protected Sub uxAddNewsButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles uxAddNewsButton.Click
        Response.Redirect(String.Format("{0}.aspx?pid=news_addnews", AppPage))
    End Sub

#End Region

#Region " Helpers and Methods "

    Private Sub SetPageState()

        If IsPrintMeOrPopUpActive() = True Then
            Me.UserActivityPanel.Visible = False
            Me.TagsPanel.Visible = False
            Me.MostRecentPagesPanel.Visible = False
            Me.MostRecentBlogsPanel.Visible = False
            Me.MostRecentEventsPanel.Visible = False
            Me.MostRecentPostPanel.Visible = False
            Me.MostRecentPollPanel.Visible = False
            Me.SlideShowsPanel.Visible = False
            Me.uxLinksPanel.Visible = False
            Me.uxAddNewsButton.Visible = False
            Me.uxAddNewsButton.Enabled = False

            UserActivityPanel.Enabled = False
            TagsPanel.Enabled = False
            MostRecentPagesPanel.Enabled = False
            MostRecentBlogsPanel.Enabled = False
            MostRecentEventsPanel.Enabled = False
            MostRecentPostPanel.Enabled = False
            MostRecentPollPanel.Enabled = False
            SlideShowsPanel.Enabled = False
            uxLinksPanel.Enabled = False

        Else
            LoadSettings()
        End If

        Me.uxAddNewsPanel.Visible = IsEditor()

    End Sub

#End Region

End Class